addLoadEvent(loadDetail());
addLoadEvent(doSomething());

function loadDetail() {
    var dl = document.createElement("dl");
    //缩写节点
    var abbrs = document.getElementsByTagName("abbr");
    for (var i = 0; i < abbrs.length; i++) {
        //缩写的定义
        var title = abbrs[i].getAttribute("title");
        //缩写
        var txt = abbrs[i].firstChild.nodeValue;

        var dt = document.createElement("dt");
        var dd = document.createElement("dd");
        var dt_txt = document.createTextNode(txt);
        var dd_txt = document.createTextNode(title);
        dt.appendChild(dt_txt);
        dd.appendChild(dd_txt);


        dl.appendChild(dt);
        dl.appendChild(dd);
    }
    var header = document.createElement("h2");
    var header_txt = document.createTextNode("Abbreviations");

    header.appendChild(header_txt);

    document.body.appendChild(dl);
    document.body.appendChild(header);

    var quotes = document.getElementsByTagName("blockquote");

    for (var i = 0; i < quotes.length; i++) {

        if (!quotes[i].getAttribute("cite")) {
            continue;
        }

        var url = quotes[i].getAttribute("cite");

        //在描述后面创建链接
        var a = document.createElement("a");
        a.setAttribute("href", url);
        a.appendChild(document.createTextNode(url));

        var quoteChildrens = quotes[i].getElementsByTagName("*");
        quoteChildrens[quoteChildrens.length - 1].appendChild(a);
    }


}

function doSomething() {
    var example = document.getElementsByTagName("abbr")[0];
    alert(example.style.border);
}
